package com.my.house.common.hook;

import com.my.house.common.utils.SpringUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 服务启动 Hook 程序
 * @author Oct
 */
@Slf4j
@Order(0)
@Component
@AllArgsConstructor
public class BootupHook implements CommandLineRunner {

    private long startTime;

    public BootupHook() {
        this.startTime = System.currentTimeMillis();
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("==========================================================");
        log.info("================={}已上线=====================", SpringUtil.getProperty("spring.application.name"));
        log.info("==========================================================");
    }

}